package com.example.string_test;

import org.checkerframework.checker.units.qual.A;
import org.junit.Test;
import org.openjdk.jol.vm.VM;

import javax.swing.*;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author csp 2021-01-08
 */
public class StringTest {

    private volatile Integer mn = 1;


    public static void main(String[] args) {
        String  str1 = null;
        String str2 = "";
        System.out.println(str1);
        System.out.println((str1 + "").equals(str2));
    }

    @Test
    public void test1() {
        AtomicInteger num = new AtomicInteger(111111);
        System.out.println(VM.current().addressOf(num));
        trans(num);
        System.out.println(VM.current().addressOf(num));
        System.out.println(num.get());
    }
    public AtomicInteger trans(AtomicInteger num) {
        System.out.println(VM.current().addressOf(num));
        num = new AtomicInteger(222222);
        System.out.println(VM.current().addressOf(num));
        return num;
    }
}
